﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace Kylin
{
    public class DataTableManager : Singleton<DataTableManager>
    {

        private Dictionary<string, DataTable> dataTableDic = new Dictionary<string, DataTable>();

        public DataTable Load(string path)
        {
            if (!dataTableDic.ContainsKey(path))
            {
                DataTable dataTable = new DataTable();
                dataTable.LoadFile(path);
                dataTableDic[path] = dataTable;
            }

            return dataTableDic[path];
        }

        public void Unload(string path)
        {
            if (dataTableDic.ContainsKey(path))
            {
                dataTableDic[path].Unload();
            }
        }
    }

}


